<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" th:href="@{../layui/css/layui.css}" media="all" />
</head>
<body>
	<div style="padding: 1em 1em 1em 1em;">
		<ul class="layui-nav layui-bg-green">
			<li class="layui-nav-item"><a onclick="deleteMessage()">删除</a></li>
			<li class="layui-nav-item"><a>标记</a>
				<dl class="layui-nav-child">

					<dd>
						<a onclick="read()">已读</a>
					</dd>
					<dd>
						<a onclick="unRead()">未读</a>
					</dd>

					<dd th:each="label:${labelList}">
						<a th:text="${label.name}" th:attr="labelId=${label.id}"
							onclick="addLabel(this)"></a>
					</dd>
				</dl></li>
			<li class="layui-nav-item"><a href="javascript:;">移动</a>
				<dl class="layui-nav-child">
					<dd th:each="folder:${folderList}">
						<a th:text="${folder.name}" th:attr="folderId=${folder.id}"
							onclick="move(this)"></a>
					</dd>
				</dl></li>
		</ul>
		<div>
		
		<form class="layui-form" style="margin-top:1em;">
				<div class="layui-form-item">
					<div class="layui-inline">
						<div class="layui-input-inline">
							<input type="text" placeholder="关键字" name="word" class="layui-input" />
						</div>
					</div>
					<div class="layui-inline">
						<select name="colomn">
							<option value="subject" selected="">主题</option>
							<option value="mailFrom">发件人</option>
							<option value="mailAddress">收件人</option>
							<option value="bodyText">内容</option>
						</select>
					</div>
					<div class="layui-inline">
						<button class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
					</div>
				</div>
			</form>
			
			<table class="layui-table" lay-filter="tableId">
				<thead>
					<tr>
						<th lay-data="{type:'checkbox'}">ID</th>
						<th lay-data="{field:'read', width:60,templet: '#read'}">已读</th>
						<th lay-data="{field:'mailFrom', width:180}">发件人</th>
						<th lay-data="{field:'subject', minWidth: 200}">主题</th>
						<th
							lay-data="{field:'hasAttachment', width:80, templet: '#attachment'}">附件</th>
						<th lay-data="{field:'sentDate', width:140}">时间</th>
						<th lay-data="{field:'label',templet: '#label'}">标签</th>
						<th lay-data="{templet: '#see'}">编辑</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	<script type="text/html" id="see">
  		<a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
	</script>
	<script type="text/html" id="label">
	{{#  if(d.label != ''){ }}
		{{#  var a=d.label.split(","); }}
		{{#  layui.each(a, function(index, item){ }}
			<span class="layui-badge layui-bg-green">{{item}}
				<i class="layui-icon" style="font-size: 15px; color: #000000;" label="{{item}}" msgid="{{d.id}}" onclick="labelRemove(this)">&#x1006;</i> 
			</span>
  		{{#  }); }}
	{{#  } }}
	</script>
	<script type="text/html" id="attachment">
  	{{#  if(d.hasAttachment === 'false'){ }}
    	否
  	{{#  } else { }}
    	是
  	{{#  } }}
	</script>
	<script type="text/html" id="read">
  	{{#  if(d.hasRead === 'true'){ }}
    	<span><i class="layui-icon" style="font-size: 15px; color: #E0E8EF;">&#xe617;</i></span>
  	{{#  } else { }}
		<span><i class="layui-icon" style="font-size: 15px; color: #5EAEF6;">&#xe617;</i></span>
  	{{#  } }}
	</script>
	<script th:inline="javascript">
		var folderId = [[${folderId}]];
	</script>
	<script th:src="@{../plugin/testH/jquery.min.js?v=2.1.4}"></script>
	<script th:src="@{../layui/layui.js}" charset="utf-8"></script>
	<script th:src="@{../js/mail/message_folder.js}" charset="utf-8"></script>

</body>

</html>